package com.lagou.test;


import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.sql.Connection;

public class maintest {

    public static void main(String[] args) throws Exception {
        /*Connection connection=null;
        java.sql.PreparedStatement preparedStatement=null;
        Class.forName("com.mysql.jdbc.Driver");
        connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/test?characterEncoding=utf-8","root","zsh123456");
        String sql="select * from user";
        preparedStatement=connection.prepareStatement(sql);

        ResultSet resultSet1 = preparedStatement.executeQuery();

        while (resultSet1.next()){
           int id= resultSet1.getInt("id");
            System.out.println(id);
        }*/

        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("mysql");
        comboPooledDataSource.setDriverClass("com.mysql.cj.jdbc.Driver");
        comboPooledDataSource.setJdbcUrl("jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=UTC");
        comboPooledDataSource.setUser("root");
        comboPooledDataSource.setPassword("zsh123456");

        Connection connection = comboPooledDataSource.getConnection();




    }
}
